﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace System.WXT.Infrstructre
{
    public interface IBaseRepository<T> where T : class,new()
    {
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> Add(T entity);
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        Task<List<T>> GetAll();
        /// <summary>
        /// 反填
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<T> GetBaby(int id);
        /// <summary>
        /// 修改 逻辑删
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> Update(T entity);
        /// <summary>
        /// 批量删除
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> Updatees(List<T> entity);
        /// <summary>
        /// 返回添加ID
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Task<int> AddAsyncs(T entity);
    }
}
